package com.hjr.calculator;

public enum CalcOp {

    ADD("+"),
    SUBTRACT("-"),
    MULTIPLY("*"),
    DIVIDE("/"),

    EQUALS("=");

    private final String operation;


    CalcOp(String operation) {
        this.operation = operation;
    }

    public String getOp() {
        return operation;
    }

    public static CalcOp getByOp(String op) {
        for (CalcOp o : CalcOp.values()) {
            if (o.operation.equals(op))
                return o;
        }
        return null;
    }
}
